// opSys.h

// Revision 7 (r7).
// Created by James Madley on 31/1/09.

// Wiivie. Convert video files to Wii compatible video.
// Copyright (C) 2009 James David Madley

// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.


#include <iostream>

#if defined (__linux) || (linux)
	#include <cstdlib>
#endif

using namespace std;

#if defined (__APPLE__) || (__linux) || (linux)
	const string operatingSystem = "UNIX";
#elif defined (_WIN32) || (__WIN32__) || (__CYGWIN__)
	const string operatingSystem = "Windows";
#else
	const string operatingSystem;
#endif

void clearFunc();
void pauseFunc();
void sleepFunc();


void clearFunc()	// Clear the screen.
{
	if ( operatingSystem == "UNIX" )
	{
		system("clear");
	}
	else if ( operatingSystem == "Windows" )
	{
		system("cls");
	}
}


void pauseFunc()	// So you can use PAUSE on Windows without screwing UNIX.
{
	if ( operatingSystem == "Windows" )
	{
		system("PAUSE");
	}
}


void sleepFunc(string x)	// Easy way to use "sleep".
{
	string sleepString;
	
	sleepString = "sleep " + x;
	system(sleepString.c_str());
}
